<template>
  <div class="school">
    <h2>学校名称：{{ name }}</h2>
    <h2>学校地址：{{ address }}</h2>
    <button @click="transMsg">消息获取</button>
  </div>
</template>

<script>
import pubsub from 'pubsub-js'
export default {
  name: "SchoolInfo",
  data() {
    return {
      name: "临沂大学",
      address: "工业大道",
    };
  },
  methods: {
    transMsg() {
        pubsub.publish('hello',666666)// 发布消息
    },
  },
};
</script>
<style scoped>
.school {
  background-color: gray;
}
</style>
